<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>async</title>
</head>
<body>
<script>
    async function add1(arr1) {
        let n1=0;
        for(let index of arr1){
            n1+=index;
        }
        return n1;
    }
    add1([1,3,5,7,9]).then(function (data) {
        alert(data);
    });

    async function add2(...arr2) {
        let n2=0;
        for(let index of arr2){
            n2+=index;
        }
        return n2;
    }
    add2(2,4,6,8,10).then(function (da) {
        alert(da);
    });
</script>
</body>
</html>